
    <div class="content margin_top_foot">
        <header class="header fixed_top bg_mx_green"></header>
        <div class="swipe">
            <div class='swipe-wrap'></div>
            <ul class="position"></ul>
        </div>
        <div class="detail"></div>
        <footer class="fixed_bottom flex_justify padding_h_15 border_t_mx bg_white detail_foot">
            <div class="relative iconfont icon-cart font_20 text_center detail_cart" onclick="location.href='<{url route='/shop/cart/index'}>'">
                <div class="badge total detail_total">1</div>
            </div>
            <div class="flex">
                <div class="btn btn_warning detail_addcart" onclick="cart()">加入购物车</div>
                <a href="<{url route='/shop/order/confirm'}>"><div class="btn btn_danger gobuy">立即购买</div></a>
            </div>
        </footer>
    </div>
    <!-- 轮播模版 -->
    <script type="text/template" charset="utf-8" id='swipe_template'></script>
    <!-- 详情模版 -->
    <script type="text/template" charset="utf-8" id='detail_template'>
        <div class="bg_white padding_10_15 border_b">
            <div class="flex_justify margin_b_10">
                <div class="font_16">{{=it.title}}</div>
                <div class="font_12">距离活动结束 <span class="bg_black padding_h_3 circle_5 lineheight_2 days">0</span> 天 <span class="bg_black padding_h_3 circle_5 hours">00</span> : <span class="bg_black padding_h_3 circle_5 minutes">00</span> : <span class="bg_black padding_h_3 circle_5 seconds">00</span></div>
            </div>
            <div class="text_info">{{=it.text}}</div>
            <div class="flex_justify">
                <div class="warning font_18 lineheight_2">￥{{=it.price}}元</div>
                <div class="label_mx_green padding_h_5 font_12 circle_5" onclick="location.href='<{url route='/shop/site/from' pigid=$pigid}>'">源头追溯</div>
            </div>
        </div>
        <div class="bg_white padding_10_15 flex_justify margin_b_10">
            <div class="font_18">购买数量</div>
            <div class="border flex text_center lineheight_3">
                <div class="padding_h_5 bg_grey padding_h_10" onclick="change_num(-1)"><i class="iconfont icon-del"></i></div>
                <div class="border_l padding_h_5 text_center padding_h_15 number">2</div>
                <div class="border_l padding_h_5 bg_grey padding_h_10" onclick="change_num(1)"><i class="iconfont icon-add"></i></div>
            </div>
        </div>
        <div class="bg_white padding_10_15 margin_b_10">{{=it.article}}</div>
        <div class="bg_white">
            <div class="mx_green lineheight_3 border_b padding_h_15"><i class="iconfont icon-xiaoxixuanzhong01 font_20"></i> 顾客评论</div>
            <div class="padding_h_15 border_b">
                {{for(var i=0;i<it.comment.length;i++){}}
                <div class="comment light border_b padding_v_10">
                    <div class="h_justify margin_b_10">
                        <div class="flex">
                            <div class="width_20">
                                <img class="circle" src="{{=it.comment[i].headimg}}" alt="">
                            </div>
                            <div class="padding_l_10">{{=it.comment[i].name}}</div>
                        </div>
                        <div class="">{{=it.comment[i].time}}</div>
                    </div>
                    <div class="">{{=it.comment[i].content}}</div>
                </div>
                {{}}}
            </div>
        </div>
    </script>
    <script>
        // 轮播模版
            var banner = <{$banner}>;
            loadswipe(banner)
        // 详情模版
            //var detail = {id:"1",title:"农家散养黑猪后腿肉500g",text:"满1000g包邮",price:"99.00",article:'<p>这里是可编辑区域，可以上传图片或者进行文字排版操作项。牧业建设生态乡优势显著，这里草药山果丰富，溪水清澈，历史上是著名的放牧地区。林间三洋的生态山竹，源自与众不同的生长环境和成长历练。</p><img src="/static/images/detail.jpg" alt="">',comment:[{headimg:"/static/images/cat.jpg",name:"elena",time:"2016-12-20",content:"妈妈很喜欢这种口感，以后每逢过节都要给老妈送，让他开开心心"},{headimg:"/static/images/cat.jpg",name:"elena",time:"2016-12-20",content:"妈妈很喜欢这种口感，以后每逢过节都要给老妈送，让他开开心心"}]};
            var detail = <{$detail}>;
            var evaldetail = doT.template($("#detail_template").text());
            loaddata(".detail",evaldetail,detail)
        // 购物车初始化及操作函数
            var total = 2;
            $(".total").html(2)
            function change_num(i){
                total += i;
                total = total<1?1:total;
                $(".number").html(total)
            }
            function cart(){
                addcart(total)
            }
        // 头部模版引入
            loadheadbar("商品详情");
            countdown(".days",".hours",".minutes",".seconds",GetTimeDiff("<{$goods['timestart']}>","<{$goods['timeend']}>"))
    </script>


